import { throttle } from '@/utils'

/**
 * 节流装饰器
 * @param wait {number}
 * @returns {(function(*, *, *): void)|*}
 */
function throttlingDecorator(wait = 200) {
  return function(target, name, descriptor) {
    descriptor.value = throttle(descriptor.value, wait)
  }
}

export default throttlingDecorator
